import { createRouter, createWebHistory } from 'vue-router'
import MainVue from "@/views/Main.vue";
import LoginVue from '@/views/account/Login.vue'
import RegisterVue from '@/views/account/Register.vue'
import HomeVue from "@/views/home/Home.vue";
import PurchaseOrderListVue from "@/views/purchase/PurchaseOrderList.vue";
import SaleOrderListVue from "@/views/sales/SaleOrderList.vue";
import MaterialListVue from '@/views/material/MaterialList.vue'
import MaterialCategoryVue from "@/views/material/MaterialCategory.vue";
import MaterialBrand from "@/views/material/MaterialBrand.vue";
import CustomerListVue from "@/views/basic/CustomerList.vue";
import VendorListVue from "@/views/basic/VendorList.vue";
import StoreList from "@/views/basic/StoreList.vue";
import InventoryList from "@/views/inventory/InventoryList.vue"
import UserList from "@/views/user/UserList.vue"

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      component: MainVue,
      redirect:'home', //重定向
      children:[
        {
          path:'/',
          name:'home',
          component:HomeVue,
        }, {
          path:'/purchaseOrderList',
          name:'purchaseOrderList',
          component:PurchaseOrderListVue,
        },
        {
          path:'/saleOrderList',
          name:'saleOrderList',
          component:SaleOrderListVue,
        }, {
          path:'/material',
          name:'materialList',
          component:MaterialListVue,
        }, {
          path:'/materialCategory',
          name:'materialCategoryList',
          component:MaterialCategoryVue,
        },{
          path:'/materialUnit',
          name:'materialUnitList',
          component:MaterialBrand,
        },{
          path:'/customerList',
          name:'customerList',
          component:CustomerListVue,
        },{
          path:'/vendorList',
          name:'vendorList',
          component:VendorListVue,
        },{
          path:'/storeList',
          name:'storeList',
          component:StoreList,
        },{
          path:'/inventoryList',
          name:'inventoryList',
          component:InventoryList,
        },{
          path:'/userList',
          name:'userList',
          component:UserList,
        }
      ]
    },{
      path: '/login',
      name:'login',
      component:LoginVue,
    },{
      path: '/register',
      name:'register',
      component:RegisterVue,
    }
  ]
})

export default router